FROM golang:1.17 AS build
WORKDIR /httpserver/
#RUN ls
COPY . .
#RUN ls
ENV CGO_ENABLED=0
ENV GO111MODULE=auto
ENV GOPROXY=https://goproxy.cn,direct
RUN GOOS=linux go build -installsuffix cgo -o httpserver httpServer.go
#RUN ls

FROM ubuntu
COPY --from=build /httpserver/httpserver /httpserver/httpserver
WORKDIR /httpserver/
ENTRYPOINT ["./httpserver"]